import request from '@/utils/request'

export default {

    //新增课程信息
    addCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/eduCourse/addCourseInfo`,
            method: 'post',
            data: courseInfo //转化json传递
        })
    },
    // 修改课程信息
    updateCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/eduCourse/updateCourseInfo`,
            method: 'post',
            data: courseInfo //转化json传递
        })
    },
    //根据id查询数据，做回显
    getCourseInfoById(id) {
        return request({
            url: `/eduservice/eduCourse/getCourseInfoById/${id}`,
            method: 'get'
        })
    },
    //根据课程id来查询课程发布信息
    getCoursePublishById(id) {
        return request({
            url: `/eduservice/eduCourse/getCoursePublishById/${id}`,
            method: 'get'
        })
    },
    //根据id发布课程
    publishCourse(id) {
        return request({
            url: `/eduservice/eduCourse/publishCourse/${id}`,
            method: 'put'
        })
    },
    //查询所有课程信息
    getCourseInfoPage(current,limit,courseQuery){
        return request({
            url: `/eduservice/eduCourse/getCourseInfoPage/${current}/${limit}`,
            method: 'post',
            data:courseQuery
          })
    },
    // 根据课程id删除有关信息
    delCourseInfo(id) {
        return request({
            url: `/eduservice/eduCourse/delCourseInfo/${id}`,
            method: 'delete'
        })
    },
}